import request from '../axios'

// 列表
export function list (self) {
  const url = '/api/order/img'
  const params = { self }
  return request.get(url, { params })
}

// 查看某个
export function info (id) {
  const url = `/api/order/img/${id}`
  return request.get(url)
}

// 存储
export function save (order, numbers, ids) {
  const url = '/api/order/img'
  const data = {
    ...order,
    numbers,
    ids,
    Loading: true
  }
  return request.post(url, data)
}

// 绑定
export function bind (orderId, mobile) {
  const url = '/api/order/bind'
  const data = {
    mobile,
    orderId,
    Loading: true
  }
  return request.post(url, data)
}

// 存储
export function pass (orderId) {
  const url = '/api/order/pass'
  const data = {
    orderId,
    Loading: true
  }
  return request.post(url, data)
}

export function refuse (orderId) {
  const url = '/api/order/refuse'
  const data = {
    orderId,
    Loading: true
  }
  return request.post(url, data)
}

export function type () {
  const url = '/api/order/type'
  return request.get(url)
}

export function goods () {
  const url = '/api/order/goods'
  return request.get(url)
}
